/**
 * @(#)ApkConfigController.java 2016年12月1日
 * Copyright(C) 2016 ZHEXIN IT CO.,LTD. All rights reserved.
 */
package org.jsbd.boss.action;

import org.jsbd.boss.dao.IMiguUsefulDataDao;
import org.jsbd.boss.domian.channel.MiguUsefulData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 *
 * @author <a href="mailto:xupengcheng@zhexinit.com" >徐鹏程</a>
 * @version 1.0.0
 */
@Controller
@RequestMapping("/miguUsefulData")
public class MiguUsefulDataController {
    public static final Logger LOGGER = LoggerFactory.getLogger(MiguUsefulDataController.class);


    @Resource
    private IMiguUsefulDataDao miguUsefulDataDao;

    @RequestMapping(value = "list", method = RequestMethod.GET)
    public String list() {
        return "/miguUsefulData/configList";
    }


    @RequestMapping(value = "configList", params = "json")
    @ResponseBody
    public Map<String, Object> configPageList(MiguUsefulData config) {
        List<MiguUsefulData> list = miguUsefulDataDao.selectList(config);
        Integer total = miguUsefulDataDao.countOfConfig(config);
        Map map = new HashMap();
        map.put("rows", list);
        map.put("total", total);
        return map;
    }


}
